@extends('layouts.console_header')

@section('title', '地推订单明细')

@section('resources')
    @parent
    <link rel="stylesheet" href="{{env('CSS_DOMAIN')}}css/jquery.dataTables.min.css?v={{env('CSS_VERSION')}}">
    <style>
    	.shop_get_shopul{width: 800px;overflow: hidden;margin: 20px 30px;}
    	.shop_get_shopul li{width: 400px;float: left;margin: 10px 0;}
    </style>
@endsection

@section('content')
<section class="user_list">
	<div style="border-bottom: 2px solid #9955c6;overflow: hidden;">
		<p class="fz_14 account_title fl" style="border: none;">
		<span style="color: #7f7f7f;">
		    <a href="/console/index">首页</a>>地推管理>
		    <a href="/console/salesman/shop/lists?cityid={{$cityid}}">地推商家列表</a>>
		    <a href="/console/salesman/shop/get?cityid={{$cityid}}&shopid={{$shopid}}">地推详情</a>>
        </span>
        <span class="co_violet">地推订单明细</span></p>
		<a onclick="history.go(-1);" href="#"><p class="fr tc back_btn">返回</p></a>
		<a href="#" onclick="export_data()"><p class="fr tc back_btn">导出</p></a>
	</div>
	<div style="background-color: #fff;">
		<ul class="shop_get_shopul">
			<li class="fz_13 co_gray56"><span>门店名称 ：</span><span>{{$info['name']}}</span></li>
			<li class="fz_13 co_gray56"><span>门店地址 ：</span><span>{{$info['address']}}</span></li>
			<li class="fz_13 co_gray56"><span>地推时间：</span><span>{{$info['contractmonth']}}个月</span></li>
			<li class="fz_13 co_gray56"><span>地推创建日：</span><span>{{$info['contractstarttime']}}</span></li>
			<li class="fz_13 co_gray56"><span>缴纳金额：</span><span>{{$info['payfee']}}元</span></li>
			<li class="fz_13 co_gray56"><span>地推到期日：</span><span>{{$info['contractlasttime']}}</span></li>
		</ul>
	    <table id="example" class="display" cellspacing="0" width="100%">
	        <thead>
	            <tr>
	                <th>序号</th>
	                <th>订单时间</th>
	                <th>订单号</th>
	                <th>注册用户</th>
	                <th>消费门店</th>
	                <th>商家代码</th>
                	<th>地推订单实付</th>
	            </tr>
	        </thead>
	        <tfoot>
	            <tr>
	                <th>序号</th>
	                <th>订单时间</th>
	                <th>订单号</th>
	                <th>注册用户</th>
	                <th>消费门店</th><!-- TODO -->
	                <th>商家代码</th>
                	<th>地推订单实付</th>
	            </tr>
	        </tfoot>
	        <tbody>
	        @foreach($lists as $list)
	            <tr>
	            @if(!isset($i))
	            	<td>{{$i=1}}</td>
                @else
                    <td>{{++$i}}</td>
                @endif
	                <td>{{date('Y-m-d H:i:s', strtotime($list['ordertime']))}}</td>
	                <td>{{$list['ordernumber']}}</td>
	                <td>{{$list['mobile']}}</td>
	                <td>{{$list['shopname']}}</td>
	                <td>{{$list['shopcode']}}</td>
	                <td>{{$list['orderamount']}}</td>
	            </tr>
            @endforeach
	        </tbody>
	    </table>
	</div>
</section>
@endsection

@section('scriptResources')
    @parent
    <script src="{{env('JS_DOMAIN')}}js/jquery.dataTables.min.js?v={{env('JS_VERSION')}}"></script>
    <script>
    	var cityid='{{$cityid}}';
        var shopid='{{$shopid}}';
        var date='{{$date}}';
        function export_data() {
            window.open("/console/salesman/shop/order/export?cityid="+cityid+"&shopid="+shopid+'&date='+date, '_blank');
        }
    </script>
@endsection